home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 18
/
CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso
/
CUCD
/
Programming
/
AmigaE
/
Src
/
Guide
/
args.e
< prev
next >
Wrap
Text File
|
1994-12-13
|
913b
|
29 lines
MODULE 'workbench/startup'
PROC main()
DEF startup:PTR TO wbstartup, args:PTR TO wbarg, i, oldlock, len
IF (startup:=wbmessage)=NIL
WriteF('Started from Shell/CLI\n Arguments: "\s"\n', arg)
ELSE
WriteF('Started from Workbench\n')
args:=startup.arglist
FOR i:=1 TO startup.numargs /* Loop through the arguments */
IF args[].lock=NIL
WriteF(' Argument \d: "\s" (no lock)\n', i, args[].name)
ELSE
oldlock:=CurrentDir(args[].lock)
len:=FileLength(args[].name) /* Do something with file */
IF len=-1
WriteF(' Argument \d: "\s" (file does not exist)\n',
i, args[].name)
ELSE
WriteF(' Argument \d: "\s", file length is \d bytes\n',
i, args[].name, len)
ENDIF
CurrentDir(oldlock) /* Important: restore current dir */
ENDIF
args++
ENDFOR
ENDIF
ENDPROC